#ifndef ACCEPTOR_H
#define ACCEPTOR_H

#include "Socket.h"
#include "InetAddress.h"
#include "TcpConnect.h"
#include <netinet/in.h>
#include <arpa/inet.h>

class Acceptor
{
private:
    Socket _socket;
    InetAddress _local;

private:
    void setAddrReuse() const;
    void setPortReuse() const;
    void bind();
    void listen() const;

public:
    Acceptor(const char *ip, unsigned short port);
    ~Acceptor();
    void ready();
    int accept();
    int fd() const;
};

#endif